<?php

use Webman\Route;
use app\admin\controller\CurdController as CurdHandler;


const PAGING_REQUEST = [CurdHandler::class,"paging"]; //统一的分页查询方法
const DETAIL_REQUEST = [CurdHandler::class,"detail"]; //统一的明细查询方法
const CREATE_REQUEST = [CurdHandler::class,"create"]; //统一的记录创建方法
const UPDATE_REQUEST = [CurdHandler::class,"update"]; //统一的记录更新方法
const DELETE_REQUEST = [CurdHandler::class,"delete"]; //统一的记录删除方法


//----------------------------------------------------------------------------------------------------------------------

Route::group("/system",function (){

    # 管理员
    Route::get("/manager",PAGING_REQUEST)->setParams(["model"=> app\admin\model\system\admin\AdminList::class]);
    Route::get("/manager/{id}",DETAIL_REQUEST)->setParams(["model"=> app\admin\model\system\admin\AdminRow::class]);
    Route::post("/manager",CREATE_REQUEST)->setParams(["model"=> app\admin\model\system\admin\AdminRow::class]);
    Route::put("/manager/{id}",UPDATE_REQUEST)->setParams(["model"=> app\admin\model\system\admin\AdminRow::class]);
    Route::delete("/manager/{id}",DELETE_REQUEST)->setParams(["model"=> app\admin\model\system\admin\AdminRow::class]);

});